<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>天气预报</title>
    <link href="https://cdn.bootcss.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
    <div class="row">
        <h3 th:text="${title}"></h3>
        <select class="custom-select" style="display: inline-block; width: 80px;" id="selectCityId">
            <option th:each="city: ${cityList}" th:value="${city.cityId}" th:text="${city.cityName}"
                    th:selected="${city.cityId eq cityId}"></option>
        </select>
    </div>
    <div th:if="${report} != null">
        <div class="row">
            <h1 class="text-success" th:text="${report.city}">城市名称</h1>
        </div>
        <div class="row">
            <p>
                空气质量指数: <span th:text="${report.aqi}"></span>
            </p>
        </div>
        <div class="row">
            <p>
                当前温度: <span th:text="${report.wendu} + '℃'"></span>
            </p>
        </div>
        <div class="row">
            <p>
                温馨提示: <span th:text="${report.ganmao}"></span>
            </p>
        </div>
        <div class="row">
            <div class="card border-info" th:each="forcast: ${report.forecast}">
                <div class="card-body text-info">
                    <p class="card-text" th:text="${forcast.date}">日期</p>
                    <p class="card-text" th:text="${forcast.type}">天气类型</p>
                    <p class="card-text" th:text="${forcast.high}">最高温度</p>
                    <p class="card-text" th:text="${forcast.low}">最低温度</p>
                    <p class="card-text" th:text="${forcast.fengxiang}">风向</p>
                </div>
            </div>
        </div>
    </div>
    <div th:if="${report} == null">
        <div class="row">
            <p>
                天气数据API服务暂不可用！
            </p>
        </div>
    </div>
</div>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/popper.js/1.14.3/esm/popper.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="/js/weather/report.js"></script>
</body>
</html>